#pragma once

#ifdef PIX5DEBUG

	#define ASSERT(cond,msg) if(!(cond))throw Error("DEBUG ASSERTION ERROR: %s:%i: %s",__FILE__,__LINE__,msg);

class CEX Debug
{
	static char* _log;

	static class Object* _firstObject;
	static class Object* _lastObject;

	Debug(){};
	
public:

	static void init();
	static void shutdown();

	static void registerObject(class Object* obj);
	static void unregisterObject(class Object* obj);

	static void write(const char* fmt,...);

};

#else
	#define ASSERT(cond,msg)

#endif

